// 本文件由自动工具 proto.py 自动生成，请勿修改
// filename test_csbuf.ts
// package test

// require "test1_csbuf"

// message Test
export class Test {
	protoid = 1001,
	t1: number = 0;
	t_2: number = 0;
	t3_: string = "";
	t4: number[] = [];


Marshal(writer: any) {
	writer.setUint8(this.t1, 1)
	writer.setUint32(this.t_2, 2)
	writer.setString(this.t3_, 3)
	writer.setArray(this.t4.length, 4)
	for (let v of this.t4) {
		writer.setUint32(v, 0)
	}
}

Unmarshal(reader: any) {
	this.t1 = reader.getUint8(1)
	this.t_2 = reader.getUint32(2)
	this.t3_ = reader.getString(3)
	let count = reader.getArray(4)
	for (let i=1; i < count; i++) {
		this.t4.push(reader.getUint32(0)))
	}
}
}

// message t2
export class t2 {
	protoid = 1002,
	t1: number = 0;
	t3: number = 0;


Marshal(writer: any) {
	writer.setUint8(this.t1, 1)
	writer.setInt16(this.t3, 2)
}

Unmarshal(reader: any) {
	this.t1 = reader.getUint8(1)
	this.t3 = reader.getInt16(2)
}
}

return test
